//------------------------------------------------------------------------------
// Copyright (C) 2007-2008 Samuel Lacroix
// This file is part of Visual Local History 2005
// 
// Visual Local History 2005 is free software; you can redistribute it
// and/or modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of the License,
// or (at your option) any later version.
// 
// Visual Local History 2005 is distributed in the hope that it will be
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with Visual Local History 2005; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
//------------------------------------------------------------------------------

#pragma once

using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
using namespace EnvDTE;
using namespace EnvDTE80;
using namespace System::IO;

#include "Connect.h"
#include "FormConfig.h"


namespace HistoryAddIn {

    /// <summary>
    /// Summary for HistoryWindow
    /// </summary>
    public ref class HistoryWindow : public System::Windows::Forms::UserControl
    {
    public:
        property DTE2 ^ ApplicationObject
        {
            DTE2 ^ get() { return applicationObject; }
            void set(DTE2 ^ value) 
            { 
                applicationObject = value; 
            }
        }
        property Connect ^ ConnectObject
        {
            Connect ^ get() { return connectObject; }
            void set(Connect ^ value) 
            { 
                connectObject = value; 
            }
        }
        
        void UpdateEnabledButtons();
        
        HistoryWindow(void)
        {
            InitializeComponent();
        }

    protected:
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        ~HistoryWindow()
        {
            if (components)
            {
                delete components;
            }
        }


    protected: 

    private:
        void ActionOpen();
        void ActionRestore();
        void ActionDelete();
        void ActionCompareLatest();
        void ActionCompareActive();
        
        void OpenBackup(String^ BackupPath, String^ FileSource);
        bool SelectedIsCurrent();
        String^ CreateTempFile(String^ FileToCopy, String^ FileSource);
        
        DTE2 ^ applicationObject;
        Connect^ connectObject;



    private: System::Windows::Forms::ToolStrip^  toolStrip1;
    private: System::Windows::Forms::ToolStripButton^  openButton;
    private: System::Windows::Forms::ToolStripButton^  deleteButton;
    private: System::Windows::Forms::ToolStripButton^  restoreButton;

    private: System::Windows::Forms::ToolStripButton^  expandButton;
    private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator2;
    private: System::Windows::Forms::ToolStripButton^  collapseButton;
    public: System::Windows::Forms::TreeView^  treeView;
    private: System::Windows::Forms::ImageList^  imageList1;
    private: System::Windows::Forms::ContextMenuStrip^  contextMenuStrip1;
    private: System::Windows::Forms::ToolStripMenuItem^  openToolStripMenuItem;
    private: System::Windows::Forms::ToolStripMenuItem^  restoreToolStripMenuItem;

    private: System::Windows::Forms::ToolStripMenuItem^  deleteToolStripMenuItem;
    private: System::Windows::Forms::ToolStripButton^  SettingsButton;

    private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator3;



    private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator1;
    private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator4;
    private: System::Windows::Forms::ToolStripSplitButton^  compareStripSplitButton;
    private: System::Windows::Forms::ToolStripMenuItem^  compareLatestButton;
    private: System::Windows::Forms::ToolStripMenuItem^  compareActiveButton;
    private: System::Windows::Forms::ToolStripMenuItem^  compareMenuItem;
    private: System::Windows::Forms::ToolStripMenuItem^  compareLatestMenuItem;
    private: System::Windows::Forms::ToolStripMenuItem^  compareActiveMenuItem;

    private: System::Windows::Forms::StatusStrip^  statusStrip1;
    public: System::Windows::Forms::ToolStripStatusLabel^  toolStripStatusLabel;













    public: 
    private: 




    private: System::ComponentModel::IContainer^  components;

        /// <summary>
        /// Required designer variable.
        /// </summary>


#pragma region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        void InitializeComponent(void)
        {
            this->components = (gcnew System::ComponentModel::Container());
            System::ComponentModel::ComponentResourceManager^  resources = (gcnew System::ComponentModel::ComponentResourceManager(HistoryWindow::typeid));
            this->toolStrip1 = (gcnew System::Windows::Forms::ToolStrip());
            this->openButton = (gcnew System::Windows::Forms::ToolStripButton());
            this->compareStripSplitButton = (gcnew System::Windows::Forms::ToolStripSplitButton());
            this->compareLatestButton = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->compareActiveButton = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->toolStripSeparator1 = (gcnew System::Windows::Forms::ToolStripSeparator());
            this->restoreButton = (gcnew System::Windows::Forms::ToolStripButton());
            this->deleteButton = (gcnew System::Windows::Forms::ToolStripButton());
            this->toolStripSeparator2 = (gcnew System::Windows::Forms::ToolStripSeparator());
            this->SettingsButton = (gcnew System::Windows::Forms::ToolStripButton());
            this->expandButton = (gcnew System::Windows::Forms::ToolStripButton());
            this->collapseButton = (gcnew System::Windows::Forms::ToolStripButton());
            this->toolStripSeparator3 = (gcnew System::Windows::Forms::ToolStripSeparator());
            this->treeView = (gcnew System::Windows::Forms::TreeView());
            this->contextMenuStrip1 = (gcnew System::Windows::Forms::ContextMenuStrip(this->components));
            this->openToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->compareMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->compareLatestMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->compareActiveMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->toolStripSeparator4 = (gcnew System::Windows::Forms::ToolStripSeparator());
            this->restoreToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->deleteToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->imageList1 = (gcnew System::Windows::Forms::ImageList(this->components));
            this->statusStrip1 = (gcnew System::Windows::Forms::StatusStrip());
            this->toolStripStatusLabel = (gcnew System::Windows::Forms::ToolStripStatusLabel());
            this->toolStrip1->SuspendLayout();
            this->contextMenuStrip1->SuspendLayout();
            this->statusStrip1->SuspendLayout();
            this->SuspendLayout();
            // 
            // toolStrip1
            // 
            this->toolStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(10) {this->openButton, this->compareStripSplitButton, 
                this->toolStripSeparator1, this->restoreButton, this->deleteButton, this->toolStripSeparator2, this->SettingsButton, this->expandButton, 
                this->collapseButton, this->toolStripSeparator3});
            this->toolStrip1->Location = System::Drawing::Point(0, 22);
            this->toolStrip1->Name = L"toolStrip1";
            this->toolStrip1->Size = System::Drawing::Size(233, 25);
            this->toolStrip1->TabIndex = 1;
            this->toolStrip1->Text = L"toolStrip1";
            // 
            // openButton
            // 
            this->openButton->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
            this->openButton->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"openButton.Image")));
            this->openButton->ImageTransparentColor = System::Drawing::Color::Black;
            this->openButton->Name = L"openButton";
            this->openButton->Size = System::Drawing::Size(23, 22);
            this->openButton->Text = L"Open";
            this->openButton->ToolTipText = L"Open in editor";
            this->openButton->Click += gcnew System::EventHandler(this, &HistoryWindow::openButton_Click);
            // 
            // compareStripSplitButton
            // 
            this->compareStripSplitButton->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
            this->compareStripSplitButton->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(2) {this->compareLatestButton, 
                this->compareActiveButton});
            this->compareStripSplitButton->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"compareStripSplitButton.Image")));
            this->compareStripSplitButton->ImageTransparentColor = System::Drawing::Color::Black;
            this->compareStripSplitButton->Name = L"compareStripSplitButton";
            this->compareStripSplitButton->Size = System::Drawing::Size(32, 22);
            this->compareStripSplitButton->Text = L"Compare...";
            // 
            // compareLatestButton
            // 
            this->compareLatestButton->Name = L"compareLatestButton";
            this->compareLatestButton->Size = System::Drawing::Size(178, 22);
            this->compareLatestButton->Text = L"With latest version";
            this->compareLatestButton->Click += gcnew System::EventHandler(this, &HistoryWindow::compareLatestButton_Click);
            // 
            // compareActiveButton
            // 
            this->compareActiveButton->Name = L"compareActiveButton";
            this->compareActiveButton->Size = System::Drawing::Size(173, 22);
            this->compareActiveButton->Text = L"With opened version";
            this->compareActiveButton->Click += gcnew System::EventHandler(this, &HistoryWindow::compareActiveButton_Click);
            // 
            // toolStripSeparator1
            // 
            this->toolStripSeparator1->Name = L"toolStripSeparator1";
            this->toolStripSeparator1->Size = System::Drawing::Size(6, 25);
            // 
            // restoreButton
            // 
            this->restoreButton->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
            this->restoreButton->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"restoreButton.Image")));
            this->restoreButton->ImageTransparentColor = System::Drawing::Color::Black;
            this->restoreButton->Name = L"restoreButton";
            this->restoreButton->Size = System::Drawing::Size(23, 22);
            this->restoreButton->Text = L"Restore";
            this->restoreButton->ToolTipText = L"Restore from selected version";
            this->restoreButton->Click += gcnew System::EventHandler(this, &HistoryWindow::restoreButton_Click);
            // 
            // deleteButton
            // 
            this->deleteButton->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
            this->deleteButton->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"deleteButton.Image")));
            this->deleteButton->ImageTransparentColor = System::Drawing::Color::Transparent;
            this->deleteButton->Name = L"deleteButton";
            this->deleteButton->Size = System::Drawing::Size(23, 22);
            this->deleteButton->Text = L"Delete";
            this->deleteButton->ToolTipText = L"Delete selected backup";
            this->deleteButton->Click += gcnew System::EventHandler(this, &HistoryWindow::deleteButton_Click);
            // 
            // toolStripSeparator2
            // 
            this->toolStripSeparator2->Name = L"toolStripSeparator2";
            this->toolStripSeparator2->Size = System::Drawing::Size(6, 25);
            // 
            // SettingsButton
            // 
            this->SettingsButton->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
            this->SettingsButton->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"SettingsButton.Image")));
            this->SettingsButton->ImageTransparentColor = System::Drawing::Color::Magenta;
            this->SettingsButton->Name = L"SettingsButton";
            this->SettingsButton->Size = System::Drawing::Size(23, 22);
            this->SettingsButton->Text = L"Settings";
            this->SettingsButton->ToolTipText = L"Settings";
            this->SettingsButton->Click += gcnew System::EventHandler(this, &HistoryWindow::SettingsButton_Click);
            // 
            // expandButton
            // 
            this->expandButton->Alignment = System::Windows::Forms::ToolStripItemAlignment::Right;
            this->expandButton->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
            this->expandButton->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"expandButton.Image")));
            this->expandButton->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
            this->expandButton->ImageTransparentColor = System::Drawing::Color::Black;
            this->expandButton->Name = L"expandButton";
            this->expandButton->Size = System::Drawing::Size(23, 22);
            this->expandButton->Text = L"Expand All";
            this->expandButton->ToolTipText = L"Expand All";
            this->expandButton->Click += gcnew System::EventHandler(this, &HistoryWindow::expandButton_Click);
            // 
            // collapseButton
            // 
            this->collapseButton->Alignment = System::Windows::Forms::ToolStripItemAlignment::Right;
            this->collapseButton->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
            this->collapseButton->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"collapseButton.Image")));
            this->collapseButton->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
            this->collapseButton->ImageTransparentColor = System::Drawing::Color::Black;
            this->collapseButton->Name = L"collapseButton";
            this->collapseButton->Size = System::Drawing::Size(23, 22);
            this->collapseButton->Text = L"Collapse All";
            this->collapseButton->Click += gcnew System::EventHandler(this, &HistoryWindow::collapseButton_Click);
            // 
            // toolStripSeparator3
            // 
            this->toolStripSeparator3->Alignment = System::Windows::Forms::ToolStripItemAlignment::Right;
            this->toolStripSeparator3->Name = L"toolStripSeparator3";
            this->toolStripSeparator3->Size = System::Drawing::Size(6, 25);
            // 
            // treeView
            // 
            this->treeView->ContextMenuStrip = this->contextMenuStrip1;
            this->treeView->Dock = System::Windows::Forms::DockStyle::Fill;
            this->treeView->FullRowSelect = true;
            this->treeView->HideSelection = false;
            this->treeView->ImageIndex = 0;
            this->treeView->ImageList = this->imageList1;
            this->treeView->Location = System::Drawing::Point(0, 47);
            this->treeView->Name = L"treeView";
            this->treeView->SelectedImageIndex = 0;
            this->treeView->ShowLines = false;
            this->treeView->Size = System::Drawing::Size(233, 239);
            this->treeView->TabIndex = 4;
            this->treeView->DoubleClick += gcnew System::EventHandler(this, &HistoryWindow::treeView_DoubleClick);
            this->treeView->MouseUp += gcnew System::Windows::Forms::MouseEventHandler(this, &HistoryWindow::treeView_MouseUp);
            this->treeView->AfterSelect += gcnew System::Windows::Forms::TreeViewEventHandler(this, &HistoryWindow::treeView_AfterSelect_1);
            this->treeView->KeyPress += gcnew System::Windows::Forms::KeyPressEventHandler(this, &HistoryWindow::treeView_KeyPress);
            this->treeView->KeyDown += gcnew System::Windows::Forms::KeyEventHandler(this, &HistoryWindow::treeView_KeyDown);
            // 
            // contextMenuStrip1
            // 
            this->contextMenuStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(5) {this->openToolStripMenuItem, 
                this->compareMenuItem, this->toolStripSeparator4, this->restoreToolStripMenuItem, this->deleteToolStripMenuItem});
            this->contextMenuStrip1->Name = L"contextMenuStrip1";
            this->contextMenuStrip1->Size = System::Drawing::Size(125, 98);
            // 
            // openToolStripMenuItem
            // 
            this->openToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"openToolStripMenuItem.Image")));
            this->openToolStripMenuItem->ImageTransparentColor = System::Drawing::Color::Transparent;
            this->openToolStripMenuItem->Name = L"openToolStripMenuItem";
            this->openToolStripMenuItem->Size = System::Drawing::Size(152, 22);
            this->openToolStripMenuItem->Text = L"Open";
            this->openToolStripMenuItem->Click += gcnew System::EventHandler(this, &HistoryWindow::openToolStripMenuItem_Click);
            // 
            // compareMenuItem
            // 
            this->compareMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(2) {this->compareLatestMenuItem, 
                this->compareActiveMenuItem});
            this->compareMenuItem->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"compareMenuItem.Image")));
            this->compareMenuItem->ImageTransparentColor = System::Drawing::Color::Black;
            this->compareMenuItem->Name = L"compareMenuItem";
            this->compareMenuItem->Size = System::Drawing::Size(124, 22);
            this->compareMenuItem->Text = L"Compare";
            // 
            // compareLatestMenuItem
            // 
            this->compareLatestMenuItem->Name = L"compareLatestMenuItem";
            this->compareLatestMenuItem->Size = System::Drawing::Size(178, 22);
            this->compareLatestMenuItem->Text = L"With latest version";
            this->compareLatestMenuItem->Click += gcnew System::EventHandler(this, &HistoryWindow::compareLatestMenuItem_Click);
            // 
            // compareActiveMenuItem
            // 
            this->compareActiveMenuItem->Name = L"compareActiveMenuItem";
            this->compareActiveMenuItem->Size = System::Drawing::Size(173, 22);
            this->compareActiveMenuItem->Text = L"With opened version";
            this->compareActiveMenuItem->Click += gcnew System::EventHandler(this, &HistoryWindow::compareActiveMenuItem3_Click);
            // 
            // toolStripSeparator4
            // 
            this->toolStripSeparator4->Name = L"toolStripSeparator4";
            this->toolStripSeparator4->Size = System::Drawing::Size(149, 6);
            // 
            // restoreToolStripMenuItem
            // 
            this->restoreToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"restoreToolStripMenuItem.Image")));
            this->restoreToolStripMenuItem->ImageTransparentColor = System::Drawing::Color::Transparent;
            this->restoreToolStripMenuItem->Name = L"restoreToolStripMenuItem";
            this->restoreToolStripMenuItem->Size = System::Drawing::Size(152, 22);
            this->restoreToolStripMenuItem->Text = L"Restore...";
            this->restoreToolStripMenuItem->Click += gcnew System::EventHandler(this, &HistoryWindow::restoreToolStripMenuItem_Click);
            // 
            // deleteToolStripMenuItem
            // 
            this->deleteToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"deleteToolStripMenuItem.Image")));
            this->deleteToolStripMenuItem->ImageTransparentColor = System::Drawing::Color::Transparent;
            this->deleteToolStripMenuItem->Name = L"deleteToolStripMenuItem";
            this->deleteToolStripMenuItem->Size = System::Drawing::Size(152, 22);
            this->deleteToolStripMenuItem->Text = L"Delete...";
            this->deleteToolStripMenuItem->Click += gcnew System::EventHandler(this, &HistoryWindow::deleteToolStripMenuItem_Click);
            // 
            // imageList1
            // 
            this->imageList1->ImageStream = (cli::safe_cast<System::Windows::Forms::ImageListStreamer^  >(resources->GetObject(L"imageList1.ImageStream")));
            this->imageList1->TransparentColor = System::Drawing::Color::Black;
            this->imageList1->Images->SetKeyName(0, L"Calendar_scheduleHS.bmp");
            this->imageList1->Images->SetKeyName(1, L"ExpirationHS.bmp");
            // 
            // statusStrip1
            // 
            this->statusStrip1->Dock = System::Windows::Forms::DockStyle::Top;
            this->statusStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(1) {this->toolStripStatusLabel});
            this->statusStrip1->Location = System::Drawing::Point(0, 0);
            this->statusStrip1->Name = L"statusStrip1";
            this->statusStrip1->Size = System::Drawing::Size(233, 22);
            this->statusStrip1->TabIndex = 5;
            // 
            // toolStripStatusLabel
            // 
            this->toolStripStatusLabel->Name = L"toolStripStatusLabel";
            this->toolStripStatusLabel->Size = System::Drawing::Size(0, 17);
            // 
            // HistoryWindow
            // 
            this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
            this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
            this->Controls->Add(this->treeView);
            this->Controls->Add(this->toolStrip1);
            this->Controls->Add(this->statusStrip1);
            this->Name = L"HistoryWindow";
            this->Size = System::Drawing::Size(233, 286);
            this->toolStrip1->ResumeLayout(false);
            this->toolStrip1->PerformLayout();
            this->contextMenuStrip1->ResumeLayout(false);
            this->statusStrip1->ResumeLayout(false);
            this->statusStrip1->PerformLayout();
            this->ResumeLayout(false);
            this->PerformLayout();

        }
#pragma endregion
    private: 
        System::Void collapseButton_Click(System::Object^  sender, System::EventArgs^  e) 
        {
            for each (TreeNode^ treeNode in treeView->Nodes)
            {
                treeNode->Collapse();
            }
        }      
    private: 
        System::Void expandButton_Click(System::Object^  sender, System::EventArgs^  e) 
        {
            treeView->ExpandAll();    
        }      
    private: 
        System::Void openButton_Click(System::Object^  sender, System::EventArgs^  e) 
        {
            ActionOpen();
        }        
    private: 
        System::Void restoreButton_Click(System::Object^  sender, System::EventArgs^  e) 
        {
            ActionRestore();
        }
    private: 
        System::Void deleteButton_Click(System::Object^  sender, System::EventArgs^  e) 
        {
            ActionDelete();
        }
    private: 
        System::Void treeView_AfterSelect_1(System::Object^  sender, System::Windows::Forms::TreeViewEventArgs^  e) 
        {
            UpdateEnabledButtons();
        }
    private: 
        System::Void treeView_KeyPress(System::Object^  sender, System::Windows::Forms::KeyPressEventArgs^  e) 
        {
            if (e->KeyChar == L'\r')
            {
                ActionOpen();
                e->Handled = true;
            }   
        }
    private: 
        System::Void treeView_DoubleClick(System::Object^  sender, System::EventArgs^  e) 
        {
            if (treeView->SelectedNode->Level != 0)
                ActionOpen();
        }
    private: 
        System::Void treeView_KeyDown(System::Object^  sender, System::Windows::Forms::KeyEventArgs^  e) 
        {
            if (e->KeyCode == Keys::Delete)
            {
                ActionDelete();
                e->Handled = true;
            }
        }
    private: 
        System::Void openToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) 
        {
            ActionOpen();
        }
    private: 
        System::Void restoreToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) 
        {
            ActionRestore();   
        }
    private: 
        System::Void deleteToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) 
        {
            ActionDelete();
        }
    private: 
        System::Void treeView_MouseUp(System::Object^  sender, System::Windows::Forms::MouseEventArgs^  e) 
        {
            // a right click doesn't select the item under the mouse, so we must do it manually
            if (e->Button == ::MouseButtons::Right)
            {
                TreeNode^ node = treeView->GetNodeAt(e->X, e->Y);
                if (node)
                    treeView->SelectedNode = node;
            }
        }
    private: 
        System::Void SettingsButton_Click(System::Object^  sender, System::EventArgs^  e) 
        {
            ConnectObject->formConfig->Visible = true;
            ConnectObject->formConfig->BringToFront();
        }
    private: 
        System::Void compareLatestButton_Click(System::Object^  sender, System::EventArgs^  e) 
        {
            ActionCompareLatest();
        }
    private: 
        System::Void compareActiveButton_Click(System::Object^  sender, System::EventArgs^  e) 
        {
            ActionCompareActive();
        }
    private: 
        System::Void compareLatestMenuItem_Click(System::Object^  sender, System::EventArgs^  e) 
        {
            ActionCompareLatest();
        }
    private: 
        System::Void compareActiveMenuItem3_Click(System::Object^  sender, System::EventArgs^  e) 
        {
            ActionCompareActive();
        }
    };
}
